<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>
<script>
import "@/assets/iconfont/iconfont.css";
import { myStorage } from "./utils/localStorage/index";
export default {
  name: "App",
  data() {
    return {
      isRouterAlive: true,
    };
  },
  provide() {
    return {
      reload: this.reload,
    };
  },
  created() {},
  methods: {
    reload() {
      this.isRouterAlive = false;
      // $nextTick()  在所有DOM都加载完成后调用
      this.$nextTick(() => (this.isRouterAlive = true));
    },
  },
  mounted() {},
  destroyed() {
    // myStorage.remove("clientId");
  },
  beforeCreate() {}, //生命周期 - 创建之前
};
</script>

<style lang="scss">
#app {
  // font-family: Avenir, Helvetica, Arial, sans-serif;
  // -webkit-font-smoothing: antialiased;
  // -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  // color: #2c3e50;
}
</style>
